﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AgencyEntityLib.BaseEntity;
using System.Text;
using AgencyEntityLib.Context;
using Ecopsy.DataTier;
using Grishko.UI;

public partial class _Default : System.Web.UI.Page 
{
  
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if(!IsPostBack )
                    MyDataBind();
    }

    private void MyDataBind()
    {
        //Tree1.DataSource = iPageController.TreeDictionaryContext.GetConstractionType();
        //Tree1.DataBind();

        //TreeControl_rb.DataSource = iPageController.TreeDictionaryContext.GetConstractionType();
        //TreeControl_rb.DataBind();

        //TreeControl_rb.DataSource  =iPageController.TreeDictionaryContext.GetConstractionType();;   
        TreeControl_rb.TreeDictionaryItemValue = iPageController.TreeDictionaryContext.GetConstractionType().BuildValue();
        TreeControl_rb.DataBind();
    }

    protected Constraction Constraction
    {
        get
        {   
            wsConstractions ws = (wsConstractions)GlobalConstants.CurrentAgency.WS_FactoryList[WS_FactoryList.wsKey_Constraction];
            string id = "4ff833b4-4020-4980-8539-146206a2ef57";
            Constraction c = ws.GetConstraction(id);
            return c;
        }

    }

   

    protected void Button1_Click(object sender, EventArgs e)
    {        
        //TreeControl_rb.F_DataSource = iPageController.TreeDictionaryContext.GetAdressProgramm;   
        TreeDictionaryItemValue v = TreeControl_rb.TreeDictionaryItemValue;
        if(null!=v)
            Button1.Text = v.GetValueAsString();

        
        
    }
}
